#ifndef __VIDEO_IN_MGR__H__
#define __VIDEO_IN_MGR__H__

#include "mediaPriv.h"
#include "VideoOut.h"
#include "VideoEnc.h"
#include "json.h"

namespace Media{

class VideoInMgr{
public:
	static VideoInMgr* instance();

	bool Start();

	bool Stop();

private:
	VideoInMgr();
	static VideoInMgr *			s_videoIn;
	bool createVideoIn();
	void initConfig();
	bool parseConfig(const Json::Value &table, VideoInOptions &inOption);
	bool parseConfig(const Json::Value &table, VideoColor &videoColor);
	bool onConfigColor(const std::string &name, const Json::Value &newTable, const Json::Value &oldTable, int &result);
	bool onConfigOptions(const std::string &name, const Json::Value &newTable, const Json::Value &oldTable, int &result);
	bool onConfigVerify(const std::string &name, const Json::Value &newTable, const Json::Value &oldTable, int &result);
private:
	VideoInput *		_videoInput    = nullptr;
	VideoInput *		_videoInputSec = nullptr;

	VideoInOptions 		_inOptions = {0, };
	VideoColor 			_videoColor = {0, };
	VideoColor	 		_secVideoColor = {0, };

};


}//namespace Media



#endif

